ci: add extension docs generation pipeline#1067
Draft
makhnatkin wants to merge 2 commits intomainfrom
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a multi-step pipeline for generating per-extension documentation pages.
All scripts live in
scripts/docs/and are invoked via a single CLI entry pointnode scripts/docs/index.mjs <command>.pnpm docs:extract) — scans all extension directories, regex-parses TypeScript sources to collect nodes, marks, actions, keymaps, input rules, plugins, presets, options, and test examples into raw Markdown files + a JSON IR (docs-gen/raw/,docs-gen/extensions.json).pnpm docs:enrich— calls OpenAI API directly (requiresOPENAI_API_KEY)scripts/docs/enrich-agent.md— a standalone instruction file you hand to a Cursor/Claude agent without any API key; the agent reads raw docs + source code and writes enriched filespnpm docs:enrich:prompts+pnpm docs:enrich:apply— export prompts as JSON, process externally, apply responsespnpm docs:assemble) — merges enriched docs intodocs-src/extensions/, patchestoc.yamlandindex.md.pnpm docs:build) — runs generate → extract → assemble → Diplodoc in one command.~70% of each page is filled deterministically from code; ~30% (description, syntax guide, serialization notes, use cases) is AI-generated.
New scripts
pnpm docs:extractdocs-gen/raw/,docs-gen/extensions.jsonpnpm docs:enrich:promptspnpm docs:enrichOPENAI_API_KEY)pnpm docs:enrich:agentpnpm docs:enrich:applypnpm docs:assembledocs-src/pnpm docs:build